<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('结算信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <!--<li>-->
                                <!--<p>授权方：</p>-->
                                <!--<select id="authorizerId" name="authorizerId">-->
                                    <!--<option value="">所有</option>-->
                                    <!--<option th:each="authorizer : ${authorizerList}" th:text="${authorizer.shortName}" th:value="${authorizer.authorizerId}"></option>-->
                                <!--</select>-->
                            <!--</li>-->
                            <li>
                                <p><span style="color: red; ">*</span>项目：</p>
                                <select id="itemId" name="itemId">
                                    <div th:switch="${#lists.size(itemList)}">
                                        <p th:case="'1'"></p>
                                        <p th:case="*">
                                            <option value="">所有</option>
                                        </p>
                                    </div>
                                    <option th:each="item : ${itemList}" th:text="${item['name']}" th:value="${item['itemId']}" th:field="*{item.itemId}"></option>
                                </select>
                            </li>
                            <!--<li class="select-time">-->
                            <li>
                                <p><span style="color: red; ">*</span>查询月：</p>
                                <!--<input type="text" class="time-input" id="month" placeholder="开始时间" name="params[month]" data-format="yyyy-MM"/>-->
                                <input type="text" id="month" placeholder="yyyy-mm" name="params[month]" width="50"/>
                                <!--<span>-</span>-->
                                <!--<input type="text" class="time-input" id="endOnlineTime" placeholder="结束时间" name="params[endOnlineTime]"/>-->
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="media:itemAlbum:exportSettlement">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" data-mobile-responsive="true"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var getSettlementList = [[${@permission.hasPermi('media:itemAlbum:settlement')}]];
        var prefix = ctx + "media/itemAlbum";

        $(function() {
            var options = {
                url: prefix + "/getSettlementList",
                exportUrl: prefix + "/exportSettlement",
                modalName: "结算信息列表",
                columns: [{
                    checkbox: false
                },
                {
                    field : 'authorizerId',
                    title : '授权方id',
                    visible: false
                },
                {
                    field : 'authorizerName',
                    title : '授权方',
                    formatter: function(value, row, index) {
                        return '<span class="badge badge-secondary"> '+ value + '</span>';
                    }
                },
                {
                    field : 'contentLevel',
                    title : '内容等级'
                },
                {
                    field : 'albumCount',
                    title : '专辑数量'
                },
                {
                    field : 'episodeAll',
                    title : '总集数'
                },
                {
                    field : 'itemId',
                    title : '项目id',
                    visible: false
                },
                {
                    field : 'itemName',
                    title : '项目名称'
                }
//                {
//                    title: '操作',
//                    align: 'left',
//                    formatter: function(value, row, index) {
//                        var actions = [];
//                        actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="itemAlbumOperateLogList(\'' + row.id + '\')" style="margin-left:4px;border-color:#aa55ed;background-color:#aa55ed;"><i class="fa fa-inbox"></i>操作详情</a>');
//                        var operateName1;
//                        var state1;
//                        var operateName2;
//                        var state2;
//                        //待出库
//                        if (row.state == 0){
//                            operateName1 = "可上线";
//                            state1 = 1;
//                            operateName2 = "不可上线";
//                            state2 = -1;
//                        //可出库
//                        }else if (row.state == 1){
//                            operateName1 = "出库";
//                            state1 = 2;
//                        //已出库
//                        }else if (row.state == 2){
//                            operateName1 = "上线";
//                            state1 = 3;
//                        //已上线
//                        }else if (row.state == 3){
//                            operateName1 = "下线";
//                            state1 = 4;
//                        //已下线
//                        }else if (row.state == 4){
//                            operateName1 = "上线";
//                            state1 = 3;
//                            operateName2 = "重新可上线";
//                            state2 = 11;
//                        //不可上线
//                        }else if (row.state == -1) {
//                            operateName1 = "重新可上线";
//                            state1 = 11;
//                        }
//
//                        if (row.state == 0){
//                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' " href="javascript:void(0)" onclick="operate(\'' + row.id  + '\',\'' + state1  + '\', \'' + operateName1  + '\')" style="margin-left:4px;border-color:#55edac;background-color:#55edac;"><i class="fa fa-check"></i>' + operateName1 + '</a> ');
//                            actions.push('<a class="btn btn-danger btn-xs ' + editFlag + ' " href="javascript:void(0)" onclick="operate(\'' + row.id  + '\',\'' + state2  + '\', \'' + operateName2  + '\')"><i class="fa fa-remove"></i>' + operateName2 + '</a> ');
//                        }else if (row.state == 4){
//                            actions.push('<a class="btn btn-primary btn-xs ' + editFlag + ' " href="javascript:void(0)" onclick="operate(\'' + row.id  + '\',\'' + state1  + '\', \'' + operateName1  + '\')"><i class="fa fa-angle-double-up"></i>' + operateName1 + '</a> ');
//                            actions.push('<a class="btn btn-warning btn-xs ' + editFlag + ' " href="javascript:void(0)" onclick="operate(\'' + row.id  + '\',\'' + state2  + '\', \'' + operateName2  + '\')"><i class="fa fa-refresh"></i>' + operateName2 + '</a> ');
//                        }else if(row.state == 1){
//                            actions.push('<a class="btn btn-info btn-xs ' + outStockFlag + '" href="javascript:void(0)" onclick="outStock(\'' + row.id + '\', \'' + state1 + '\')"><i class="fa fa-plus"></i>' + operateName1 + '</a>');
//                        }else if(row.state == 2){
//                            actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="operate(\'' + row.id  + '\',\'' + state1  + '\', \'' + operateName1  + '\')"><i class="fa fa-angle-double-up"></i>' + operateName1 + '</a> ');
//                        }else if(row.state == 3){
//                            actions.push('<a class="btn btn-danger btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="operate(\'' + row.id  + '\',\'' + state1  + '\', \'' + operateName1  + '\')"><i class="fa fa-angle-double-down"></i>' + operateName1 + '</a> ');
//                        }else if(row.state == -1){
//                            actions.push('<a class="btn btn-warning btn-xs ' + editFlag + ' " href="javascript:void(0)" onclick="operate(\'' + row.id  + '\',\'' + state1  + '\', \'' + operateName1  + '\')"><i class="fa fa-refresh"></i>' + operateName1 + '</a> ');
//                        }
////                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除推荐</a>');
//                        return actions.join('');
//                    }
//                }
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>